<template>
  <div class="bread-thump-row">
    <div class="bread-thump-col" @click="goToPage(item)" v-for="(item, index) in routerList">
      {{item.label}} <span>/</span>
    </div>
  </div>
</template>

<script>
export default {
  name: "breadThump",
  props: {

  },
  data() {
    return {
      routerList: []
    }
  },
  mounted() {
    if(window.localStorage.getItem('historyRoute')) {
      this.routerList = JSON.parse(window.localStorage.getItem('historyRoute'))
    }
  },
  methods: {
    refreshMenu() {
      this.routerList = []
      if(window.localStorage.getItem('historyRoute')) {
        this.routerList = JSON.parse(window.localStorage.getItem('historyRoute'))
      }
    },
    goToPage(row) {
      this.$router.push(row.page)
      this.$emit('deleteOtherRoute', row)
    }
  }
}
</script>

<style scoped lang="scss">
  .bread-thump-row{
    max-width: 100%;
    display: flex;
    font-size: 14px;
    color: #606266;
    font-weight: bold;
    margin-bottom: 10px;
  }
  .bread-thump-col{
    cursor: pointer;
  }
</style>
